<h2 style="background-color:#368EE0; color:white; font-size:20px; padding:5px;"> Group </h2>

<p align="right"><a href="<?php echo site_url('settings/group/create_group');?>">Add Group</a></p>
<!--<div id="infoMessage"><?php echo $message;?></div>-->

<table class="table table-striped table-bordered" width="100%" id="example">
	<thead>
    <tr>
		<th>Group Name</th>
		<th>Parent group</th>
        <th>Action</th>
	</tr>
    </thead>
	<?php foreach ($users as $user):?>
		<tr>
			<td><?php echo $user->name;?></td>
			<td><?php  $name=$this->accgroup_model->getGroupByID($user->parent);
			if(isset($name['name'])){echo $name['name'] ;}else{ echo "Parent Group";}?></td>
			<td><?php echo anchor("settings/group/edit_group/".$user->id, 'Edit') ;?>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="<?php echo site_url('settings/group/delete_group/').'/'.$user->id;?>" onclick="return confirm('Are you sure you want to DELETE this task ??')">Delete</a>
		</tr>
	<?php endforeach;?>
</table>

<!--<p><a href="<?php echo site_url('auth/create_user');?>">Create a new user</a> | <a href="<?php echo site_url('auth/create_group');?>">Create a new group</a>
<a href="<?php echo site_url('auth/logout');?>">Logout</a>
</p>-->
